/**
 * 环境模块
 */
import types from "../types";


const state = {
  envId: '',
  envName: ''
};

// getters
const getters = {
  envId: state => state.envId,
  envName: state => state.envName
};

// actions
const actions = {
  setCurrentEnv ({ commit, state }, payload) {
    commit(types.SET_CURRENT_ENV, payload);
  }
};

// mutations
const mutations = {
  [types.SET_CURRENT_ENV] (state, obj) {
    state.envId = obj.envId;
    state.envName = obj.envName;
  }
};

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
